// webpack.config.js
var ExtractTextPlugin = require('extract-text-webpack-plugin');

module.exports = {
    entry:{
        baseCss:__dirname + "/src/javascripts/baseCss.js"
    },
    output:{
        path:__dirname + "/public/javascripts/",
        filename:"[name].js"
    },
     module:{
        loaders:[
            {
                test:/\.css$/,
                // loader:'style-loader!css-loader'
                loader:ExtractTextPlugin.extract({
                  fallback: "style-loader",
                  use: "css-loader"
                })
            },
            {
                test:/\.(png|jpg)$/,
                loader:'url-loader?limit=8192&name=../images/baseCss/[name].[ext]'
            },
            {
                // 专供iconfont方案使用的，后面会带一串时间戳，需要特别匹配到
                test: /\.(woff|woff2|svg|eot|ttf)\??.*$/,
                loader: 'file-loader?name=../stylesheets/fonts/[name].[ext]',
            },
        ]
    },
    plugins:[
        new ExtractTextPlugin("../stylesheets/base_header.css")
    ]
}